package com.example.androidtest.work3.bind;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import androidx.annotation.Nullable;


public class MyService extends Service {
    private static final String TAG = "MyService";

    /**
     * 把IBinder返回给客户端
     * @param intent
     * @return
     */
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.v(TAG, "Service is invoke onBind");
        return null;
    }

    /**
     *
     * @param intent
     * @return
     * 解除绑定时调用
     */
    @Override
    public boolean onUnbind(Intent intent) {
        Log.v(TAG, "Service is invoke onUnbind");
        return super.onUnbind(intent);
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.v(TAG, "Service is invoke onStartCommand");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onCreate() {
        Log.v(TAG, "Service is invoke onCreate");
        super.onCreate();
    }

    @Override
    public void onDestroy() {
        Log.v(TAG, "Service is invoke onDestroy");
        super.onDestroy();
    }

    public int getCount(){
        return getCount();
    }

}
